import { createRouter, createWebHistory } from 'vue-router'
import Home from '../components/pages/home.vue'
import About from '../components/pages/about.vue'

// Todo视图
import TodayView from '../views/todo/TodayView.vue'
import AllTasksView from '../views/todo/AllTasksView.vue'
import CategoryView from '../views/todo/CategoryView.vue'
import SettingsView from '../views/todo/SettingsView.vue'

const routes = [
  { path: '/home', component: Home },
  { path: '/about', component: About },
  
  // Todo应用路由
  { path: '/today', component: TodayView },
  { path: '/all', component: AllTasksView },
  { path: '/category/:id', component: CategoryView },
  { path: '/settings', component: SettingsView },
  
  // 默认重定向到今日任务
  { path: '/', redirect: '/today' }
]

const router = createRouter({
  history: createWebHistory(),
  routes,
})

export default router